import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../layout/Index'
import Table from '../views/table/Table.vue'
import Login from '../views/login/Login.vue'
import About from '../views/chart/About.vue'
import Pie from '../views/chart/Pie.vue'
import Home from '../views/Home.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Index,
    redirect: '/index',
    children: [
      {
        path: 'index',
        name: 'Index',
        component: Home
      },
      {
        path: '/table',
        name: 'Table',
        component: Table
      },
      {
        path: '/chart',
        name: 'chart',
        component: About
      },
      {
        path: '/pie',
        name: 'pie',
        component: Pie
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  }
  
]

const router = new VueRouter({
  routes,
  mode:'history'   //去除#号
})

export default router
